<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
      <h1>图书借阅系统</h1>
      <form action="find">
          图书分类:
          <select name="book_type">
              <option value="-1">--请选择--</option>
              <option value="1">小说</option>
              <option value="2">文学</option>
              <option value="3">IT</option>
              <option value="4">艺术</option>
              <option value="5">科幻</option>
              <option value="6">管理</option>
          </select>
          图书名称:<input type="text" name="book_name">
          是否借阅:
          <select name="is_borrow">
              <option value="-1">--请选择--</option>
              <option value="0">未借阅</option>
              <option value="1">已借阅</option>
          </select>
          <input type="submit" value="查询"><br/>
      </form>

     <span>当前用户<a th:text="${session.user.user_code}"></a></span>
      <a th:href="@{/logout}" th:text="退出">退出</a>
     <table border="1px" >
         <thead>
         <tr>
             <td>图书编号</td>
             <td>图书分类</td>
             <td>图书名称</td>
             <td>作者</td>
             <td>出版社</td>
             <td>借阅</td>
         </tr>
         </thead>
        <tbody>
        <tr th:each="books:${book}">
            <td th:text="${books.book_id}"></td>
            <td>
                <span th:if="${books.book_type == 1}" th:text="'小说'"></span>
                <span th:if="${books.book_type == 2}" th:text="'文学'"></span>
                <span th:if="${books.book_type == 3}" th:text="'IT'"></span>
                <span th:if="${books.book_type == 4}" th:text="'艺术'"></span>
                <span th:if="${books.book_type == 5}" th:text="'科幻'"></span>
                <span th:if="${books.book_type == 6}" th:text="'管理'"></span>
            </td>
            <td th:text="${books.book_name}"></td>
            <td th:text="${books.book_author}"></td>
            <td th:text="${books.publish_press}"></td>
            <td>
                <a th:if="${books.is_borrow==0}" th:text="申请借阅" th:href="@{/borrow.html}"></a>
                <span th:if="${books.is_borrow==1}" th:text="已借阅"></span>
            </td>
        </tr>
        </tbody>

     </table>

</body>
</html>